﻿ <script type="text/javascript">
  	$(document).ready(function(){
		//begin 
		$('#txt-username').css('color','#636363');
		$('#txt-username').focus(function(){
			$(this).css('color','#000000');
			$(this).attr('value','');
		});
		$('#txt-username').blur(function(){
		var value = $(this).attr('value');
		if (value == ""){
			$(this).css('color','#636363');
			$(this).attr('value','Tên đăng nhập của bạn');
			}
		});//end 
		//begin 
		$('#txt-pass').css('color','#636363');
		$('#txt-pass').focus(function(){
			$(this).css('color','#000000');
			$(this).attr('value','');
		});
		$('#txt-pass').blur(function(){
		var value = $(this).attr('value');
		if (value == ""){
			$(this).css('color','#636363');
			$(this).attr('value','Mật khẩu của bạn');
			}
		});//end 
		
		//begin
		$('.cat-center ul li ul li').hide();
		$('.cat-center ul li').hover( function(){
			if($(this).children('.cat-center ul li ul').children('.cat-center ul li ul li').is(':hidden'))
			{
				$(this).children('.cat-center ul li ul').children('.cat-center ul li ul li').slideDown('slow');
			}
			else
			{
				$(this).children('.cat-center ul li ul').children('.cat-center ul li ul li').slideUp('slow');
			}
		});
		//end
		
		//BEGIN UPDATE SCRIPT 18.5.2012: add script
		var num_news = 4;
		var cur_news = 1;
		function changeContent( _cur_news){
			for(var i=1; i<=num_news; i++){
				if(i!=_cur_news)
					$('#content'+i).fadeOut(1000).hide();	
				else
					$('#content'+i).fadeIn(1000).show();
			}
		}
		
		changeContent(cur_news);
		
		$('.news-hot .swicher-paging p a').click( function(){
			var $this=$(this);	
			$('.news-hot .swicher-paging p a').removeClass('selected');
			$this.addClass('selected');
			cur_news = $this.text();
			changeContent( cur_news);
			});
		
		setInterval(function(){
			cur_news ++; 
			if(cur_news > num_news) cur_news =1;
			$('.news-hot .swicher-paging p a').removeClass('selected');
			$('#link' + cur_news).addClass('selected');
			changeContent(cur_news);
		}, 10000);
		//END UPDATE SCRIPT 18.5.2012: add script
		
	});
  </script>